<?php

	/***************************\
	*							*
	*	Ranking Data functions	*
	*							*
	\***************************/
	
	require_once("configure.php");
	require_once("googlecode.php");
	require_once("dao.php");

	function SetupRankingData()
	{
		$dataMod = array();
		$dataStruct = array();

		$data = arrayCSV();
		$dataMod = CSVCleaner($data, $dataMod);
		$dataStruct = dataManagement($dataMod, $dataStruct);

		dataCSV($dataStruct);
	}
	
	function GetRankingData($prizeId)
	{
		if($prizeId == null)
		{
			$prizeId = getCurrentPrize();
		}
		
		$prizeInfo = getPrize($prizeId);
		$groupName = getGroupFromPrize($prizeId)["Name"];
		$rankingList = getRankingList($prizeId);
		
		return array("PrizeInfo" => $prizeInfo, "GroupName" => $groupName, "RankingList" => $rankingList);
	}
	
	function GetHistoryData()
	{
		return getHistoryTree();
	}

?>

	